package com.tqy.docms.controller;

import com.tqy.docms.entity.Lsjc;
import com.tqy.docms.service.LsjcService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @title: LsjcController
 * @projectName: docms
 * @description: 历史进程 API
 * @author: yuzf
 * @date: 2019/6/28 9:20
 */
@RestController
public class LsjcController {

    private static final Logger LOG = LoggerFactory.getLogger(LsjcController.class);

    @Autowired
    private LsjcService lsjcService;
    /*
    * 增加历史进程
    * */
    @PostMapping("/addLsjc")
    int addLsjc(Lsjc lsjc){
        int result = lsjcService.addLsjc(lsjc);
        return result;
    }
    /*
    * 删除历史进程
    * */
    @GetMapping("/delLsjc")
    int delLsjc(@RequestParam String nm){
        int result = lsjcService.delLsjc(nm);
        return result;
    }
    /*
    * 修改历史进程
    * */
    @PostMapping("/editLsjc")
    int editLsjc(Lsjc lsjc){
        int result = lsjcService.editLsjc(lsjc);
        return result;
    }
    /*
    * 获得所有的历史进程
    * */
    @GetMapping("/getallLsjc")
    List<Lsjc> getallLsjc(){
        List<Lsjc> lsjcs = lsjcService.getallLsjc();
        return lsjcs;
    }
    /*
    * 获得某个历史进程
    * */
    @GetMapping("/getoneLsjc")
    Lsjc getoneLsjc(String nm){
        Lsjc lsjc = lsjcService.getoneLsjc(nm);
        return lsjc;
    }
    /*
    * 多条件查询历史进程
    * */
    @PostMapping("/selectLsjc")
    List<Lsjc> selectLsjc(Lsjc lsjc){
        List<Lsjc> lsjcs = lsjcService.selectLsjc(lsjc);
        return lsjcs;
    }


}
